<div class="content-page" ng-controller="RolesGroupsCtrl">
  <!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
  <bsmodal id="addRoleToGroup" title="Add group to role"
    close="hideModal" closelabel="Cancel"
    extrabutton="addRoleToGroupDialog" extrabuttonlabel="Add" ng-cloak>
  <div class="btn-group">
    <a class="btn dropdown-toggle filter-selector"
      data-toggle="dropdown"> <span class="filter-label">{{$parent.path
        !== '' ? $parent.title : 'Select a group...'}}</span> <span
      class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <li ng-repeat="group in $parent.groupsTypeaheadValues"
        class="filterItem"><a ng-click="setRoleModal(group)">{{group.title}}</a></li>
    </ul>
  </div>
  </bsmodal>

  <bsmodal id="removeGroupFromRole" title="Confirmation"
    close="hideModal" closelabel="Cancel"
    extrabutton="removeGroupFromRoleDialog" extrabuttonlabel="Leave"
    ng-cloak>
  <p>Are you sure you want to remove the group from the role(s)?</p>
  </bsmodal>


  <div class="users-section">
    <div class="button-strip">
      <a class="help_tooltip"
        ng-mouseover="help.sendTooltipGA('group add user button')"
        ng-show="help.helpTooltipsEnabled" href="#"
        ng-attr-tooltip="{{tooltip_roles_groups_add_group}}"
        tooltip-placement="left">(?)</a>
      <button class="btn btn-primary"
        ng-click="showModal('addRoleToGroup')">Add Group to
        Role</button>
      <button class="btn btn-primary"
        ng-disabled="!hasGroups || !valueSelected(rolesCollection.groups._list)"
        ng-click="showModal('removeGroupFromRole')">Remove
        Group(s) from Role</button>
    </div>
    <table class="table table-striped">
      <tr class="table-header">
        <td style="width: 30px;"><input type="checkbox"
          ng-show="hasGroups" id="selectAllCheckBox"
          ng-model="roleGroupsSelected"
          ng-click="selectAllEntities(rolesCollection.groups._list,this,'roleGroupsSelected')"></td>
        <td>Title</td>
        <td>Path</td>
      </tr>
      <tr class="zebraRows"
        ng-repeat="group in rolesCollection.groups._list">
        <td><input type="checkbox" ng-model="group.checked">
        </td>
        <td>{{group._data.title}}</td>
        <td>{{group._data.path}}</td>
      </tr>
    </table>
    <div style="padding: 10px 5px 10px 5px">
      <button class="btn btn-primary" ng-click="getPrevious()"
        style="display: {{previous_display">< Previous</button>
      <button class="btn btn-primary" ng-click="getNext()"
        style="display: {{next_display" style="float:right;">Next
        ></button>
    </div>
  </div>
</div>
